-
Notifications
You must be signed in to change notification settings - Fork 19
Expand peer registry usage and improve reputation system for catchup #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
70a538b to
c409711
Compare
5c9f984 to
07fe262
Compare
07fe262 to
78c3f3f
Compare
|
🤖 Claude Code Review Status: Complete This PR adds catchup status reporting and peer registry integration to the BlockValidation service. The implementation is functional but several architectural concerns raised by reviewers need addressing: Key Issues from Review:
No Critical Bugs Found: The P2P methods (IsPeerMalicious, IsPeerUnhealthy) mentioned as "missing" are actually implemented in services/p2p/handle_catchup_metrics.go:226-338. The P2P client is properly cached in daemon/daemon_stores.go:110. Recommendation: Focus on addressing the architectural feedback about client initialization patterns and the secret mining detection logic. The functionality appears sound but the structure should align better with project conventions. |
This comment was marked as outdated.
This comment was marked as outdated.
…o peerRegistryViewer
…o peerRegistryViewer
…o peerRegistryViewer
|
|
|
||
| if commonAncestorMeta.Invalid { | ||
| return errors.NewProcessingError("[catchup][%s] common ancestor %s at height %d is marked invalid, not catching up", catchupCtx.blockUpTo.Hash().String(), commonAncestorHash.String(), commonAncestorMeta.Height) | ||
| return errors.NewBlockInvalidError("[catchup][%s] common ancestor %s at height %d is marked invalid, not catching up", catchupCtx.blockUpTo.Hash().String(), commonAncestorHash.String(), commonAncestorMeta.Height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this trigger a reputation hit? I don't think it should, since the block is valid, but the previous block is invalid. That's why it previously was NewProcessingError
…o peerRegistryViewer
…o peerRegistryViewer
…e into dylan/peerRegistryViewer
…o peerRegistryViewer
…o peerRegistryViewer


This pull request introduces a new catchup status reporting feature to the BlockValidation service and its HTTP API, along with internal refactoring to support peer tracking and P2P client integration. Additionally, it updates several generated protobuf files due to a protoc version change.
Catchup Status Reporting and API Integration:
/catchup/status) in the asset service that queries the BlockValidation service for real-time catchup status, including peer, progress, and error details. (services/asset/httpimpl/GetCatchupStatus.go[1]services/asset/httpimpl/http.go[2]GetCatchupStatusgRPC method in the BlockValidation server to provide detailed catchup progress and previous attempt information for monitoring and dashboards. (services/blockvalidation/Server.goservices/blockvalidation/Server.goR442-R496)BlockValidation Service Refactoring and P2P Client Integration:
p2pClientfor peer registry and reporting, replacing the previous peer metrics structure, and updated its constructor and daemon startup logic to inject this dependency. (daemon/daemon_services.go[1] [2];services/blockvalidation/Server.go[3] [4] [5] [6] [7]services/blockvalidation/Server.go[1] [2]Testing and Mocking Enhancements:
GetCatchupStatusmethod for improved testability. (services/blockvalidation/Client_test.goservices/blockvalidation/Client_test.goR49-R55)services/blockvalidation/BlockValidation_test.goservices/blockvalidation/BlockValidation_test.goL234-R234)Protobuf and Dependency Updates:
errors/error.pb.go[1]model/model.pb.go[2]services/alert/alert_api/alert_api.pb.go[3]services/alert/alert_api/alert_api_grpc.pb.go[4]services/asset/asset_api/asset_api.pb.go[5]services/blockassembly/blockassembly_api/blockassembly_api.pb.go[6]services/blockassembly/blockassembly_api/blockassembly_api_grpc.pb.go[7]services/blockchain/blockchain_api/blockchain_api.pb.go[8]services/blockchain/blockchain_api/blockchain_api_grpc.pb.go[9]Other Improvements:
services/blockvalidation/Server.goservices/blockvalidation/Server.goR568-R574)These changes collectively improve the observability, extensibility, and reliability of the catchup and block validation processes, while also modernizing peer tracking and supporting infrastructure.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24]